package com.dingwen.treasure.kettle.dto.modify;

import com.dingwen.treasure.kettle.base.convert.model.impl.AbstractBeanConvertImpl;
import com.dingwen.treasure.kettle.base.valid.ValidGroup;
import com.dingwen.treasure.kettle.entity.TaskInfo;
import com.dingwen.treasure.kettle.enums.FileTypeEnum;
import com.dingwen.treasure.kettle.enums.TaskTypeEnum;
import com.dingwen.treasure.kettle.vo.TaskInfoVo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;


/**
 * 　TaskInfoDto
 * 　@author dingwen
 * 　@date 2022/8/22
 */
@ApiModel(value = "TaskInfoDto", description = "任务信息数据传输对象-新增-修改")
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
public class TaskInfoDto extends AbstractBeanConvertImpl<TaskInfo, TaskInfoDto, TaskInfoVo> {

    @ApiModelProperty(value = "任务名称")
    private String taskName;

    @ApiModelProperty(value = "任务Id")
    @NotNull(message = "编辑id不能为空", groups = {ValidGroup.Modify.class})
    @Null(message = "新增时任务Id必须为空", groups = {ValidGroup.Save.class})
    private Long taskId;

    @ApiModelProperty(value = "任务类型：1一次性任务 2周期性任务")
    private TaskTypeEnum taskType;

    /**
     * 任务code标识
     */
    @ApiModelProperty(value = " 任务code标识")
    @NotNull(message = "任务code不能为空")
    private String taskCode;

    /**
     * cron表达式
     */
    @ApiModelProperty(value = "cron表达式")
    private String cronExpression;

    /**
     * 任务执行类 全类名，Job类
     */
    @ApiModelProperty(value = " 任务执行类 全类名，Job类")
    private String fullClassName;

    /**
     * jobDataMap json格式
     */
    @ApiModelProperty(value = " jobDataMap json格式")
    private String jobDataMap;

    /**
     * job组名称
     */
    @ApiModelProperty(value = "job组名称")
    private String jobGroupName;

    /**
     * job 名称
     */
    @ApiModelProperty(value = "job 名称")
    private String jobName;

    /**
     * 触发器组名称
     */
    @ApiModelProperty(value = " 触发器组名称")
    private String triggerGroupName;

    /**
     * 触发器名称
     */
    @ApiModelProperty(value = "触发器名称")
    private String triggerName;


    /**
     * 文件Id
     */
    @ApiModelProperty(value = "文件Id")
    @NotNull(message = "文件Id不能为空", groups = {ValidGroup.Save.class})
    @Null(message = "文件Id不允许修改", groups = {ValidGroup.Modify.class})
    private String fileId;

    /**
     * 文件类型
     */
    @ApiModelProperty(value = "文件Id")
    @NotNull(message = "新增时文件类型不能为空", groups = {ValidGroup.Save.class})
    @Null(message = "文件类型不允许修改", groups = {ValidGroup.Modify.class})
    private FileTypeEnum fileType;


}
